#ifndef H_BUILDBUDDY_UTILS_H
#define H_BUILDBUDDY_UTILS_H

#include <stdbool.h>
#include <sys/time.h>
#include <time.h>

// We must define this for popen
//#ifndef _XOPEN_SOURCE
//#define _XOPEN_SOURCE
//#endif

// Errors
void bb_fatal(char const* text);
void bb_fatal_errno(char const* text);

// Filesystem
bool bb_is_file_or_dir_hidden(char const* name);
bool bb_is_source_file(char const* name);

// Time
void bb_current_time(struct timeval* output);
void bb_format_time(struct timeval const* t, char* output);

// Misc
void bb_announce_event(struct timeval const* time, unsigned event_id, 
                       char const* message);

#endif

